Skip to content

Conversation

sirhcel
Copy link
Member

@sirhcel sirhcel commented Sep 19, 2025

An addendum to #610 for streamlining the interface of HistoryBuf even further. I'm opening this PR with two proposals for starting a discussion.

There is already `as_slice()` which gives access to the underlying
backing array where the elements are not in the order of writing.

With automatic dereferencing, functions like `iter()` or `windows()` are
automatically available for `HistoryBuf` and are returning items in an
order which does not reflect the write order and will likely surprise
users which did not carefully read all the documentation on for
`HistoryBuf` like me.
Some method names already contain statements on ordering like
`oldest_ordered()`. In this context a method returning an unordered
slice should state this clearly.
HistoryBuf already uses extend in method names for ingesting multiple
items at once and other heapless containers use push for methods
ingesting a single item. Let's be more consistent with this naming
scheme by switching from write to push here as well.
@sirhcel sirhcel force-pushed the historybuf-api-streamlining branch from dfd37f8 to 05a15b1 Compare September 19, 2025 13:38
@sgued sgued mentioned this pull request Sep 19, 2025
2 tasks
@sgued
Copy link
Contributor

sgued commented Sep 19, 2025

LGTM, but is a breaking change like #610. Added to #613

@sgued sgued added the API Break Breaking changes label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Break Breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants